<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//dpm($data);
?>
<table>
    <tr><th>Organization</th><th>Campaign</th><th>Start Date</th><th>End Date</th><th>Goal</th><th>Achievement</th></tr>

    <?php foreach ($data as $key => $value) : ?>
        <tr class="orderRow">
            <td><?php echo $value['org_title']; ?></td>
            <td><a href="javascript:void(0);" id="campaign_<?php echo $key;?>"><?php echo $value['campaign_title']; ?></a></td>
            <?php 
                $start = explode('T', $value['start_time']);
                $end = explode('T', $value['end_time']);
            ?>
            <td><?php echo $start[0]; ?></td>
            <td><?php echo $end[0]; ?></td>
            <td><?php echo '$'.$value['goal']; ?></td>
            <td><?php echo '$'.$value['amount_money']; ?></td>
        </tr>
        <?php foreach ($value['product_list'] as $item) : ?>
            <tr class="productList campaign_<?php echo $key;?>">
                <td></td>
                <td></td>
                <td><?php echo $item->title; ?></td>
                <td><?php echo '$'.($item->cost + $item->price); ?></td>
                <td><?php echo $item->qty; ?></td>
                <td><?php echo '$'.($item->cost + $item->price)*$item->qty; ?></td>
            </tr>
        <?php endforeach; ?>
    <?php endforeach; ?>
</table>

<?php echo $pager; ?>

